home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 7
/
Apprentice-Release7.iso
/
Environments
/
Small Eiffel 0.4.8
/
misc
/
basic_test
next >
Wrap
Text File
|
1997-04-13
|
5KB
|
207 lines
#!/bin/csh -f
# Some Basic Tests including Kernel Classes
#
# Usage : basic_test [args_for_compile]
#
#set verbose = 1
if (!($?SmallEiffel)) then
echo "Environment Variable 'SmallEiffel' not set."
exit 1
endif
set compile=${SmallEiffel}/bin/compile
set clean=${SmallEiffel}/bin/clean
echo Testing ${compile} $* > /dev/tty
echo Options : $*
###################################################################
${clean} HELLO_WORLD >& /dev/null
${compile} $* HELLO_WORLD > /dev/null
./a.out
/bin/rm -f ./a.out
###################################################################
cd ${SmallEiffel}/lib_test
echo -n "Testing ."
foreach t (vide.e test_*.e)
# echo $t
${clean} $t >& /dev/null
${compile} $* $t > /dev/null
if (${status}) then
echo Error While Compiling ${t}
else
echo -n "."
endif
if (!(-x ./a.out)) then
echo No a.out for file ${t}
else
echo -n "."
endif
./a.out
if (${status}) then
echo Error While Running ${t}
else
echo -n "."
/bin/rm -f ./a.out
endif
end
cd ${SmallEiffel}/bin
###################################################################
${clean} BOOST_IS_STATIC >& /dev/null
${compile} -boost BOOST_IS_STATIC > /dev/null
echo -n "."
./a.out
/bin/rm -f ./a.out
echo -n "."
###################################################################
cd ${SmallEiffel}/lib_test
foreach act (all_check_test*.e)
${compile} -all_check $act > /dev/null
${clean} $act >& /dev/null
echo -n "."
./a.out
/bin/rm -f ./a.out
end
echo -n "."
cd ${SmallEiffel}/bin
###################################################################
${clean} testargs >& /dev/null
${compile} $* -o testargs TESTARGS > /dev/null
testargs
echo -n "."
testargs 1
echo -n "."
testargs 2 arg2
echo "."
/bin/rm -f testargs
###################################################################
echo "TRY_ANIMAL"
${clean} TRY_ANIMAL >& /dev/null
${compile} $* TRY_ANIMAL > /dev/null
./a.out
/bin/rm -f ./a.out
###################################################################
echo "TRY_PRINT_ON"
${clean} TRY_PRINT_ON >& /dev/null
${compile} $* TRY_PRINT_ON > /dev/null
./a.out
/bin/rm -f ./a.out
###################################################################
echo "Compiling SmallEiffel/lib_show"
cd ${SmallEiffel}/bin
${clean} PYRAMID >& /dev/null
${compile} $* PYRAMID > /dev/null
echo -n "."
${clean} PYRAMID2 >& /dev/null
${compile} $* PYRAMID2 > /dev/null
echo -n "."
${clean} SPREAD_ILLNESS >& /dev/null
${compile} $* SPREAD_ILLNESS > /dev/null
echo -n "."
/bin/rm -f ./a.out
################################
${clean} FIBONACCI >& /dev/null
${compile} $* FIBONACCI > /dev/null
set x = `a.out 4`
if ($x == 5) then
echo -n "."
else
echo error while running lib_show/fibonacci
endif
echo -n "."
/bin/rm -f ./a.out
################################
cd ${SmallEiffel}/lib_show/parking
${clean} RUN_PARKING >& /dev/null
${compile} $* RUN_PARKING > /dev/null
/bin/rm -f ./a.out
echo -n "."
################################
cd ${SmallEiffel}/lib_show/gcd
${clean} TEST_GCD >& /dev/null
${compile} $* TEST_GCD > /dev/null
echo -n "."
./a.out
/bin/rm -f ./a.out
echo -n "."
###################################################################
cd ${SmallEiffel}/lib_show/external
${clean} EXTERNAL_DEMO >& /dev/null
${compile} $* EXTERNAL_DEMO src.c > /dev/null
./a.out >! output2
if ($status) then
echo "Error in lib_show/external."
exit 1
endif
diff output2 output
if ($status) then
echo "Error while running lib_show/external/external_demo"
exit 1
endif
/bin/rm -f output2 src.o ./a.out
echo -n "."
###################################################################
cd ${SmallEiffel}/lib_show/cecil
foreach d (example*)
cd ${SmallEiffel}/lib_show/cecil
cd ${d}
${clean} EXAMPLE >& /dev/null
/bin/rm -f a.out eiffel.h tmp
${compile} $* EXAMPLE -cecil cecil.se c_prog.c > /dev/null
./a.out >! tmp
if ($status) then
echo "Error in lib_show/cecil/${d}"
exit 1
endif
diff tmp output
if ($status) then
echo "Error while running lib_show/cecil/${d}"
exit 1
endif
${clean} EXAMPLE >& /dev/null
/bin/rm -f a.out eiffel.h tmp
echo -n "."
end
echo -n "."
###################################################################
cd ${SmallEiffel}/lib_show
foreach d (bench*)
cd ${SmallEiffel}/lib_show
cd ${d}
foreach b (*_bench.e)
/bin/rm -f a.out
${clean} ${b} >& /dev/null
${compile} $* ${b} > /dev/null
if ($status) then
echo "Error while compiling lib_show/${d}/${b}"
exit 1
endif
echo -n "."
./a.out
if ($status) then
echo "Error while running lib_show/${d}/${b}"
exit 1
endif
echo -n "."
${clean} $b >& /dev/null
/bin/rm -f a.out
end
end
################################
cd ${SmallEiffel}/lib_rand
foreach d (demo*.e)
/bin/rm -f a.out
${clean} $d >& /dev/null
${compile} $* $d > /dev/null
if ($status) then
echo "Error in lib_rand/${d}"
exit 1
endif
if (!(-x ./a.out)) then
echo No a.out for ${SmallEiffel}/lib_rand/${d}
else
echo -n "."
endif
end
/bin/rm -f a.out
echo -n "."
echo " Done."